Skip to content

chore: fix mise on Windows - #219

Closed
richardthe3rd wants to merge 3 commits into
mainfrom
claude/epic-meninsky
Closed

chore: fix mise on Windows#219
richardthe3rd wants to merge 3 commits into
mainfrom
claude/epic-meninsky

Conversation

@richardthe3rd

Copy link
Copy Markdown
Owner

Summary

  • ./bin/mise is a Unix-only bootstrap script and does not work on Windows (Git Bash / MINGW64) — AGENTS.md and CLAUDE.md updated to document using system mise instead
  • Added windows_default_inline_shell_args = "bash -c" to mise.toml — without this, mise uses cmd /c on Windows which only executes the first line of any multiline task script
  • Simplified dev task to a single-line run (avoids a separate mise bug where temp script shebangs get `\r` appended when spawned from a native Windows process)
  • Added [prepare.flutter-deps] so flutter pub get runs automatically when pubspec.yaml changes, with outputs set so it skips when already up-to-date — removes the need for a manual install task
  • Added .gitattributes forcing LF for *.toml and *.sh — CRLF in TOML breaks the windows_default_inline_shell_args setting and CRLF in shell scripts breaks shebangs
  • Added flutter-dev.pid to .gitignore

Test plan

  • On macOS/Linux: `./bin/mise run test` and `./bin/mise run analyze` still pass
  • On Windows: `mise run test` and `mise run analyze` pass
  • On Windows: `MISE_ENV=dev mise run dev` starts the Flutter dev server (all task lines execute)
  • On Windows: `flutter pub get` runs automatically on first `mise run` after a fresh checkout, but is skipped on subsequent runs when `pubspec.yaml` is unchanged

🤖 Generated with Claude Code

- Add windows_default_inline_shell_args = "bash -c" so multiline mise
  tasks run all lines (default cmd /c only ran the first line)
- Simplify dev task to single-line (avoids temp-script CRLF shebang bug)
- Add [prepare.flutter-deps] with sources/outputs so flutter pub get
  runs automatically on pubspec.yaml changes but skips when up-to-date
- Add .gitattributes forcing LF for *.toml and *.sh (CRLF in toml breaks
  the bash shell args setting; CRLF in sh breaks shebangs)
- Add flutter-dev.pid to .gitignore
- Update AGENTS.md and CLAUDE.md: ./bin/mise does not work on Windows,
  use system mise instead; remove install task docs (replaced by prepare)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 28, 2026 17:49
@github-actions

github-actions Bot commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

LCOV of commit 77f7251 during CI #51

Summary coverage rate:
  lines......: 77.6% (2237 of 2883 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@codecov

codecov Bot commented Mar 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves cross-platform developer tooling by making mise tasks work reliably on Windows while keeping the existing macOS/Linux workflow intact.

Changes:

  • Configure mise to use bash for inline task execution on Windows and simplify the dev task to avoid multiline-script issues.
  • Replace the manual dependency install task with an automatic prepare step that runs flutter pub get when pubspec.yaml changes.
  • Update agent/docs guidance for Windows usage, add LF-enforcing .gitattributes, and ignore a Flutter dev PID file.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
mise.toml Adds Windows inline shell settings and an automatic flutter pub get prepare step.
mise.dev.toml Simplifies the dev task to a single-line command.
AGENTS.md Documents Windows usage and updates dependency guidance to mise prepare.
CLAUDE.md Updates guidance to use system mise on Windows instead of ./bin/mise.
.gitattributes Forces LF line endings for .toml/.sh to avoid Windows CRLF issues.
.gitignore Ignores flutter-dev.pid.

Comment thread CLAUDE.md Outdated
Comment thread mise.toml
Comment on lines +13 to +14
# Use bash for inline task scripts on Windows (default is cmd /c which only runs one line)
windows_default_inline_shell_args = "bash -c"

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

windows_default_inline_shell_args = "bash -c" makes all inline task scripts on Windows depend on bash being available on PATH. If someone runs mise from PowerShell/cmd without Git Bash/WSL installed, tasks will fail immediately. Consider either documenting the bash prerequisite for Windows contributors or switching the Windows inline shell to something guaranteed (e.g. PowerShell).

Suggested change
# Use bash for inline task scripts on Windows (default is cmd /c which only runs one line)
windows_default_inline_shell_args = "bash -c"
# Use PowerShell for inline task scripts on Windows (default is cmd /c which only runs one line)
windows_default_inline_shell_args = "powershell -NoProfile -Command"

Copilot uses AI. Check for mistakes.
Comment thread AGENTS.md
Comment on lines +89 to 90
| `flutter pub get` | automatic (mise prepare) | Runs automatically on `pubspec.yaml` changes |
| `dart run build_runner build --delete-conflicting-outputs` | `./bin/mise run generate` | After model changes, before tests |

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs now say flutter pub get runs automatically via mise prepare, but this file still lists the base tasks as including an install task. Since mise.toml removed [tasks.install], please update the “Available: …” list to remove install (or reintroduce the task) so the documentation matches the actual task set.

Copilot uses AI. Check for mistakes.
Comment thread AGENTS.md
Comment on lines +115 to +117
# Windows (Git Bash / PowerShell)
mise run test
MISE_ENV=dev mise run build:web

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section suggests Windows users can run tasks from PowerShell, but mise.toml configures Windows inline task scripts to run via bash -c. That will only work from PowerShell if bash is installed and on PATH (e.g. via Git for Windows). Please clarify the prerequisite (or adjust the guidance) to avoid “bash not found” failures.

Copilot uses AI. Check for mistakes.
Comment thread .gitattributes Outdated
richardthe3rd and others added 2 commits March 28, 2026 17:54
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Cloudflare Pages Preview

Your preview deployment is ready!

Preview URL: https://claude-epic-meninsky.staging-cambeerfestival.pages.dev

This preview will be automatically updated when you push new commits to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants